package view
{
	import map.data.BirthPoint;
	
	import flash.display.Sprite;
	import flash.filters.GlowFilter;
	
	public class BirthPointView extends Sprite
	{
		private var _birthPoint:BirthPoint;
		private var _selected:Boolean;
		public function BirthPointView(birthPoint:BirthPoint)
		{
			super();
			_birthPoint = birthPoint;
			var color:uint = 0xff0000;
			switch(_birthPoint.team)
			{
				case 0:
					break;
				case 1:
					color = 0x0000ff;
					break;
			}
			this.graphics.beginFill(color);
			this.graphics.drawCircle(_birthPoint.x,_birthPoint.y,20);
			this.graphics.endFill();
		}

		public function get selected():Boolean
		{
			return _selected;
		}

		public function set selected(value:Boolean):void
		{
			if(_selected == value)return;
			_selected = value;
			if(_selected)
			{
				this.filters = [new GlowFilter(0xffff00,0.8,10,10,10)];
			}else
			{
				this.filters = [];
			}
		}

		public function get birthPoint():BirthPoint
		{
			return _birthPoint;
		}

		public function set birthPoint(value:BirthPoint):void
		{
			_birthPoint = value;
		}

		
	}
}